﻿using System.Collections.Generic;
using élénkPróbája.extentions;
using élénkPróbája.results;
using élénkPróbája.validators;

namespace élénkPróbája.Test.dto
{
    public class Company
    {
        public int Id { get; set; }
        public string Name { get; set; }
        public string PublicName { get; set; }
        public string[] RoutingNames { get; set; }
        public List<Account> Accounts { get; set; } 
        public List<Account> Ledger { get; set; } 
        public Person Owner { get; set; } 
        public List<Company> SubCompanies { get; set; }
        public List<Person>  Employees { get; set; }
        public ValidationResult Validate()
        {
            return Validator.Validate(this);
        }

        public static readonly InlineValidator<Company> Validator = new InlineValidator<Company>() {
                v => v.RuleFor(x => x.Name).NotNull(),
                v => v.RuleFor(x => x.Id).NotEqual(0)
            };
    }
    
}